<input id="upfile" type="file" name="excelFile"/>

<script type="application/javascript">
    $(function(){

        var layerIndex = parent.layer.getFrameIndex(window.name); //获取窗口索引
        $("#btn_save").click(function(){
            var type =1;
            var formData = new FormData();
            formData.append("excelFile",document.getElementById("upfile").files[0]);
            var url ="http://"+window.location.host+"/examin/readExcel?examinId=${examinId!}&type=1";
            $.ajax({
                url: url,
                type: 'POST',
                data: formData,
                dataType:'json',
                cache: false, // 不缓存
                processData: false,
                contentType: false
            }).done(function(ret){
                if (ret) {
                    if(ret.code==0){
                        alert("添加成功")

                        closeTab();
                    }else{
                        alert(ret.message);
                    }
                }else{
                    alert("上传失败")
                    return false;
                }
            });
            return false;
        })
        $("#btn_close").click(function(){
            closeTab();
        })


    })

</script>



